package com.adam.example.types;

import com.adam.example.search.converter.MapToGeometryConverter;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import org.elasticsearch.geometry.Geometry;

@JsonIgnoreProperties(ignoreUnknown = true)
public class GeoCityShape {

    private String name;
    @JsonDeserialize(converter = MapToGeometryConverter.class)
    private Geometry location;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Geometry getLocation() {
        return location;
    }

    public void setLocation(Geometry location) {
        this.location = location;
    }

    @Override
    public String toString() {
        return "GeoCity{" +
                "name='" + name + '\'' +
                ", location=" + location +
                '}';
    }
}
